package com.dcdrake.testApp;

import java.util.ArrayList;

import classes.Event;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class ViewDescriptionActivity extends Activity {

	Event event;
	ArrayList<Event> list;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.viewdescription);

		list = ((myApp) this.getApplication()).getList();

		Intent mIntent = getIntent();
		int listIndex = mIntent.getIntExtra("listIndex", 0);
		event = list.get(listIndex);
		TextView descriptionView = (TextView) findViewById(R.id.description);
		descriptionView.setText(event.getDescription());
	}
	
	public void onClick(View view){
		Intent addIntent = new Intent(view.getContext(), CampusEventsActivity.class);
    	startActivity(addIntent);
    	finish();
	}

}
